package com.L1ngg.Demo1.apiDemo;

import java.sql.SQLOutput;

public class StringBuilderDemo1 {
    public static void main(String[] args) {
        //1.创建对象
        StringBuilder sb = new StringBuilder();

        //2.添加元素
        sb.append("Hello");
        sb.append("World");

        //3.反转
        sb.reverse();
        System.out.println(sb);

        //4.获取长度
        int len = sb.length();
        System.out.println(len);

        //转换成字符串
        String str = sb.toString();
        System.out.println(str);

    }
}
